package eu.news.data.hibernate.pojo;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import eu.news.data.pojo.Interface;
import eu.news.data.pojo.Operator;

/**
 * 本地提供的接口
 * @author WZZ
 *
 */
@Entity
@Table(name="interface")
public class HB_Interface extends Interface implements java.io.Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = -3319219110393983109L;

	/**
	 * 主键
	 */
	@Id
	@Column(length=100,nullable=false)
	String id;
	
	/**
	 * @see POWER
	 */
	@Column(nullable=false)
	int power;
	
	/**
	 * 绑定IP或域名
	 */
	@Column(length=200,nullable=false)
	String bindIpOrDomain;

	@ManyToOne(cascade=CascadeType.ALL,
			targetEntity=HB_Operator.class,
			fetch=FetchType.LAZY
		)
	@JoinColumn(name="operator",nullable=false)
	HB_Operator operator;
	
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public int getPower() {
		return power;
	}

	public void setPower(int power) {
		this.power = power;
	}

	public String getBindIpOrDomain() {
		return bindIpOrDomain;
	}

	public void setBindIpOrDomain(String bindIpOrDomain) {
		this.bindIpOrDomain = bindIpOrDomain;
	}

	@Override
	public Operator getOperator() {
		return operator;
	}

	@Override
	public void setOperator(Operator operator) {
		this.operator = (HB_Operator) operator;
	}
}
